#include "bsp_tim.h"
#include "app_control.h"

TIM_HandleTypeDef htim10;


uint8_t BspTimInit(void)
{
    __HAL_RCC_TIM10_CLK_ENABLE();
   
    htim10.Instance = TIM10;
    htim10.Init.Prescaler = 9999;
    htim10.Init.CounterMode = TIM_COUNTERMODE_UP;
    htim10.Init.Period = 30;//10000;
    htim10.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
    htim10.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE;
    if (HAL_TIM_Base_Init(&htim10) != HAL_OK)
    {
    return 1;
    }
    HAL_NVIC_SetPriority(TIM1_UP_TIM10_IRQn, 0, 0);
    HAL_NVIC_EnableIRQ(TIM1_UP_TIM10_IRQn);

    return 0;
}


void TIM1_UP_TIM10_IRQHandler(void)
{
  HAL_TIM_IRQHandler(&htim10);
}


void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{

}
